From: Juergen Gross Date: Wed, 23 Aug 2017 17:34:00 +0000 (+0200) Subject: xen/arch/x86/numa.c: let custom parameter parsing routines return errno X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1589 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=010117779729adca0c7eadf120070ec09a3477b8;p=xen.git xen/arch/x86/numa.c: let custom parameter parsing routines return errno Modify the custom parameter parsing routines in: xen/arch/x86/numa.c to indicate whether the parameter value was parsed successfully. Signed-off-by: Juergen Gross Acked-by: Wei Liu Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index ffeba6e180..32914bce27 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -18,7 +18,7 @@ #include #include -static int numa_setup(char *s); +static int numa_setup(const char *s); custom_param("numa", numa_setup); #ifndef Dprintk @@ -291,14 +291,14 @@ void numa_set_node(int cpu, nodeid_t node) } /* [numa=off] */ -static __init int numa_setup(char *opt) -{ +static __init int numa_setup(const char *opt) +{ if ( !strncmp(opt,"off",3) ) numa_off = true; - if ( !strncmp(opt,"on",2) ) + else if ( !strncmp(opt,"on",2) ) numa_off = false; #ifdef CONFIG_NUMA_EMU - if ( !strncmp(opt, "fake=", 5) ) + else if ( !strncmp(opt, "fake=", 5) ) { numa_off = false; numa_fake = simple_strtoul(opt+5,NULL,0); @@ -307,14 +307,16 @@ static __init int numa_setup(char *opt) } #endif #ifdef CONFIG_ACPI_NUMA - if ( !strncmp(opt,"noacpi",6) ) + else if ( !strncmp(opt,"noacpi",6) ) { numa_off = false; acpi_numa = -1; } #endif + else + return -EINVAL; - return 1; + return 0; } /*